<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:custom="http://faces.componete/jsf"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:a4j="http://richfaces.org/a4j">

    <body>

        <ui:composition template="./Template.xhtml">

            <ui:define name="content">
                <h:form name="form1" id="form1" >
                    <fieldset class="camposCompleto"><legend >DADOS DA EMPRESA</legend>
                        <table  align="center" border="0" >
                            <tr><h:messages/>
                                <td  class="label">
                                    <label>código empresa:</label>
                                </td>
                                <td>
                                    <h:inputText readonly="true" id="codEmpresa" value="#{EmpresaBo.selectFilial.codEmpresa}" styleClass="textFieldPequeno" />
                                </td>
                                <td class="label">
                                    <label>CNPJ:</label>
                                </td>
                                <td>
                                    <h:inputText value="#{EmpresaBo.selectFilial.cnpj}"  id="Cnpj" styleClass="textFieldPequeno" onkeypress="return formataCampo(this,13,18)"/>
                                </td>
                            </tr>
                            <tr>

                            </tr>
                            <tr>
                                <td class="label"><label>Insc. Estadual</label></td>
                                <td><h:inputText value="#{EmpresaBo.selectFilial.inscricaoEstadual}" onkeypress="return formataCampo(this,2,20)" id="inscricaoEstadual" maxlength="20" styleClass="textFieldPequeno"/> </td>
                                <td class="label" >Insc. Municipal</td>
                                <td ><h:inputText  value="#{EmpresaBo.selectFilial.inscricaoMunicipal}" onkeypress="return formataCampo(this,2,20)" styleClass="textFieldPequeno" id="inscricaoMunicipal" maxlength="20"/>  </td>

                            </tr>
                            <tr>
                                <td class="label" >Razão Social</td>
                                <td ><h:inputText  value="#{EmpresaBo.selectFilial.razaoSocial}" styleClass="textFieldEscritas" id="razaoSocial" maxlength="50"/>  </td>

                                <td class="label">Nome Fantasia</td>
                                <td><h:inputText  value="#{EmpresaBo.selectFilial.nomeFantasia}" styleClass="textFieldEscritas" id="nomeFantasia" maxlength="50"/>  </td>
                            </tr>
                            <tr>
                                <td class="label" >Ramo Atividade</td>
                                <td><h:inputText value="#{EmpresaBo.selectFilial.ramoAtividade}" styleClass="textFieldEscritas" id="ramoAtividade" maxlength="50"  />  </td>
                                <td class="label" >Porte Empresa</td>
                                <td>
                                    <h:selectOneRadio class="label" id="subscriptions" value="#{EmpresaBo.selectFilial.porteEmpresa}">
                                        <f:selectItem id="micro" itemLabel="Micro Empresa" itemValue="M" />
                                        <f:selectItem id="normal" itemLabel="Normal" itemValue="N" />
                                    </h:selectOneRadio>
                                </td>
                            </tr>

                            <tr>
                                <td class="label" >Logradouro</td>
                                <td >
                                    <h:inputText  value="#{EmpresaBo.selectFilial.logradouro}" styleClass="textFieldGrande" id="logradouro" maxlength="50"/>
                                </td>
                                <td class="label" >Complemento</td>
                                <td >
                                    <h:inputText  value="#{EmpresaBo.selectFilial.complemento}" styleClass="textFieldEscritas" id="complemento" maxlength="50"/>
                                </td>
                            </tr>
                            <tr>
                                <td class="label">Número</td>
                                <td><h:inputText  value="#{EmpresaBo.selectFilial.numero}" styleClass="textFieldPequeno" id="numero" maxlength="10"  onkeypress="return formataCampo(this,2,10)"/></td>
                                <td class="label" >Bairro</td>
                                <td >
                                    <h:inputText  value="#{EmpresaBo.selectFilial.bairro}" styleClass="textFieldEscritas" id="bairro" maxlength="50"/>
                                </td>

                            </tr>
                            <tr>
                                <td class="label" >UF</td>
                                <td ><h:selectOneMenu styleClass="comboBoxUf"  value="#{EmpresaBo.uf}">
                                        <f:selectItem itemLabel="Selecione" itemValue="GO"/>
                                        <f:selectItem itemLabel="AC" itemValue="AC"/>
                                        <f:selectItem itemLabel="AL" itemValue="AL"/>
                                        <f:selectItem itemLabel="AP" itemValue="AP"/>
                                        <f:selectItem itemLabel="AM" itemValue="AM"/>
                                        <f:selectItem itemLabel="BA" itemValue="CA"/>
                                        <f:selectItem itemLabel="CE" itemValue="CE"/>
                                        <f:selectItem itemLabel="DF" itemValue="DF"/>
                                        <f:selectItem itemLabel="ES" itemValue="ES"/>
                                        <f:selectItem itemLabel="GO" itemValue="GO"/>
                                        <f:selectItem itemLabel="MA" itemValue="MA"/>
                                        <f:selectItem itemLabel="MG" itemValue="MG"/>
                                        <f:selectItem itemLabel="MS" itemValue="MT"/>
                                        <f:selectItem itemLabel="MT" itemValue="MS"/>
                                        <f:selectItem itemLabel="PA" itemValue="PA"/>
                                        <f:selectItem itemLabel="PB" itemValue="PB"/>
                                        <f:selectItem itemLabel="PE" itemValue="PE"/>
                                        <f:selectItem itemLabel="PI" itemValue="PR"/>
                                        <f:selectItem itemLabel="PR" itemValue="PI"/>
                                        <f:selectItem itemLabel="RJ" itemValue="RJ"/>
                                        <f:selectItem itemLabel="RN" itemValue="RN"/>
                                        <f:selectItem itemLabel="RS" itemValue="RS"/>
                                        <f:selectItem itemLabel="RO" itemValue="RO"/>
                                        <f:selectItem itemLabel="RR" itemValue="RR"/>
                                        <f:selectItem itemLabel="SC" itemValue="SC"/>
                                        <f:selectItem itemLabel="SE" itemValue="SE"/>
                                        <f:selectItem itemLabel="SP" itemValue="SP"/>
                                        <f:selectItem itemLabel="TO" itemValue="TO"/>
                                        <a4j:support event="onchange" ajaxSingle="true" action="#{EmpresaBo.actionCarregarCidade}"  reRender="cidade"/>

                                    </h:selectOneMenu>
                                </td>
                                <td class="label" >Cidades</td>
                                <td>
                                    <h:selectOneMenu defaultLabel="Selecione" converterMessage="Cidade invalida" name="cidade" id="cidade" class="comboBox" value="#{EmpresaBo.selectFilial.cidade}">
                                        <f:converter converterId="CidadeConverter"/>
                                        <f:selectItems value="#{EmpresaBo.cidadesSystem}"/>
                                    </h:selectOneMenu>
                                </td>
                            </tr>
                            <tr>
                                <td class="label" >Telefone</td>
                                <td> <h:inputText  value="#{EmpresaBo.selectFilial.telefone}" styleClass="textFieldPequeno" id="telefone" onkeypress="return formataCampo(this,12,13)"/></td>
                                <td class="label" >Fax</td>
                                <td> <h:inputText  value="#{EmpresaBo.selectFilial.fax}" styleClass="textFieldPequeno" id="fax" onkeypress="return formataCampo(this,12,13)"/></td>
                            </tr>
                            <tr>
                                <td class="label" >Email</td>
                                <td> <h:inputText  value="#{EmpresaBo.selectFilial.email}" styleClass="textFieldGrande" id="email" maxlength="50"/> </td>
                                <td class="label" >Contato</td>
                                <td> <h:inputText  value="#{EmpresaBo.selectFilial.contato}" styleClass="textFieldGrande" id="contato" maxlength="50"/></td>
                            </tr>
                            <tr>
                                <td class="label">Reg. Junta Comercial</td>
                                <td> <h:inputText  value="#{EmpresaBo.selectFilial.registroJuntaComercial}" styleClass="textFieldPequeno" id="regjuntaComercial" maxlength="20"/></td>
                                <td class="label">Endereço Internet</td>
                                <td> <h:inputText  value="#{EmpresaBo.selectFilial.homePage}" styleClass="textFieldGrande" id="homePage" maxlength="50"/></td>
                            </tr>
                        </table>
                    </fieldset>
                    <h:outputText styleClass="labelAlerta" value="#{EmpresaBo.mensagem}" />
                    <custom:botoesCadastro
                        formulario="#{EmpresaBo}"
                        formulario2="#{EmpresaBo.selectFilial}"
                        labelBotaolimpar="Limpar"
                        labelBotaoconsultar="Consultar"
                        labelBotaoexcluir="Excluir"
                        labelBotaosalvar="Salvar"
                        labelBotaofechar="Fechar"/>

                </h:form>
            </ui:define>

        </ui:composition>

    </body>
</html>
